`
https://leetcode.cn/problems/single-number/
`

/**
 * @param {number[]} nums
 * @return {number}
 */
var singleNumber = function (nums) {
  let res = 0;
  for (let n of nums) {
    res ^= n;
  }
  // 根据异或运算规则，所有字符的异或结果就是多出来的那个字符
  return res;
};